import { createApp, watch } from 'vue'
import App from './App.vue'
import router from './router'
// import store from './store'
import { createPinia } from 'pinia'

import '@/style/index.scss'

const pinia = createPinia()
console.log("🚀 ~ file: main.ts:10 ~ pinia:", pinia)


// createApp(App).use(store).use(router).mount('#app')
const app = createApp(App)
console.log("🚀 ~ file: main.ts:15 ~ app:", app)

// eslint-disable-next-line @typescript-eslint/no-explicit-any
app.config.globalProperties.clog = (...args: any[]) => {
    console.log('%c [MSG]:', 'color: coral; font-size: 15px;', ...args)
    return false
};

app.use(pinia).use(router).mount('#app')


// pinia stores持久化到本地缓存
watch(pinia.state, (state) => {
    localStorage.setItem('pinaState', JSON.stringify(state))
}, { deep: true })

// 开启 performance
app.config.performance = true